/**
 * Copyright (c) Enalean, 2018. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

.backlog-item {
    &.gu-transit {
        height: 4px;
        margin: $tlp-spacing 10px;
        border-radius: 3px;
        opacity: 1;
        background: $tlp-theme-color;

        > .backlog-item-show-children,
        > .backlog-item-details {
            display: none;
        }
    }

    &.gu-mirror {
        opacity: 1;
        height: auto !important;

        > .backlog-item-show-children {
            display: none;
        }

        > .backlog-item-details {
            @extend %hide-moves-icons;
        }
    }

    &.appending-child {
        > .backlog-item-details {
            border: 1px solid $tlp-ui-info;
            background: transparentize($tlp-ui-info, .9);
        }
    }
}

.backlog-item-details {
    &.undraggable {
        @extend %hide-moves-icons;
        cursor: auto;
    }

    &.selected {
        transition: border-color 75ms ease-in-out, background-color 75ms ease-in-out;
        border-color: $tlp-ui-info;
        background: transparentize($tlp-ui-info, .9);
    }

    &.shaking {
        transition: border-color 75ms ease-in-out, background-color 75ms ease-in-out;
        animation: shake 750ms ease-in-out;
        border-color: $tlp-ui-danger;
        background-color: transparentize($tlp-ui-danger, .9);
    }

    &.multiple {
        &::before,
        &::after {
            content: '';
            visibility: visible;
            position: absolute;
            z-index: -1;
            top: 0;
            width: 100%;
            height: 100%;
            border: 1px solid #efefef;
            border-radius: 3px;
            background: #fdfdfd;
            box-shadow: inset 5px 0 0 0 #aaaaaa, 0 1px 0 0 rgba(242, 242, 242, .5);
        }

        &::before {
            animation: stackedFirstCard 100ms ease-in-out forwards;
        }

        &::after {
            animation: stackedSecondCard 100ms ease-in-out forwards;
        }
    }

    &.hidden {
        display: none;

        + .backlog-item-show-children {
            display: none;
        }
    }
}

@keyframes stackedFirstCard {
    0% {
        left: -8px;
        transform: rotate(-1deg);
    }

    100% {
        left: -8px;
        transform: rotate(-2.5deg);
    }
}

@keyframes stackedSecondCard {
    0% {
        left: 8px;
        transform: rotate(1deg);
    }

    100% {
        left: 8px;
        transform: rotate(2.5deg);
    }
}
